<div class="blog_wrapper">
    <?if(count($posts)) : ?>

        <? foreach($posts as $post) : ?>
            <div class="blog_item">
                <div class="blog_item_left">
                    <div class="blog_image">
                        <a href="<?=Request::$controller?>index/<?=$post['alias']?>/"> <img src="<?=Model_Directory::itemImagePath($post,'blogMini')?>" alt=""></a>
                    </div>
                </div>
                <div class="blog_item_right">
                    <div class="blog_item_header">
                        <div class="blog_item_header_left"><a href="<?=Request::$controller?>index/<?=$post['alias']?>/"><?=$post['name']?></a></div>
                        <div class="blog_item_header_right"><?=$post['date']?></div>
                    </div>
                    <div class="blog_item_text">
                        <?=$post['text1']?>
                    </div>
                    <div class="blog_item_bottom">
                        <div class="blog_item_bottom_left">
                            <a href="<?=Request::$controller?>index/<?=$post['alias']?>/"></a>
                        </div>
                        <div class="blog_item_bottom_right">
                            <span class="blog_views_icon"></span>
                            <span class="blog_views_count"><?=Model_Manager::getViews($post['id'])?></span>
                            <span class="blog_comments_icon"></span>
                            <span class="blog_comments_count"><?=count(Model_Manager::getCommentsByPostId($post['id']))?></span>
                        </div>

                    </div>
                </div>
            </div>
        <? endforeach; ?>


    <? endif; ?>

</div>
<div style="text-align: center;display: none;" id="upBlock"><img src="/images/loader.gif" alt=""/></div>

<script type="text/javascript">
        autoScroll("index/noalias/",$('.blog_wrapper'),$('#upBlock'));
</script>